package com.ciis.system.org.controller;

import com.ciis.base.page.IPage;
import com.ciis.base.page.Page;
import com.ciis.system.org.domain.TSysOrg;
import com.ciis.system.org.service.ISysOrgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created with IntelliJ IDEA.
 * User: zhangdajun
 * Date: 14-5-22
 * Time: 下午8:57
 * To change this template use File | Settings | File Templates.
 */
@RequestMapping("org")
@Controller
public class SysOrgController {

    @Autowired
    ISysOrgService sysOrgService;

    @RequestMapping(value="",method = RequestMethod.GET)
    public String org(String id)throws Exception{
        return "web/system/org/orgList";
    }

    @RequestMapping(value="list/{id}/{name}",method = RequestMethod.GET)
    public @ResponseBody IPage<TSysOrg> getPage(String id)throws Exception{
        IPage page = new Page();
        return sysOrgService.getListForPage(page,new TSysOrg());
    }
}
